home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / bm.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  2.0 KB  |  78 lines

  1. /**/
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  7. if AddLibrary("rxmui.library")~=0 then exit
  8.  
  9. call RxMUIOpt("debugmode showerr")
  10. call CreateApp
  11. call HandleApp
  12. /* never reached */
  13. /***********************************************************************/
  14. HandleApp: procedure
  15.     ctrl_c=2**12
  16.     do forever
  17.         call NewHandle("app","h",ctrl_c)
  18.         if and(h.signals,ctrl_c)>0 then exit
  19.         select
  20.             when h.event="QUIT" then exit
  21.             otherwise interpret h.event
  22.         end
  23.     end
  24.     /* never reached */
  25. /***********************************************************************/
  26. CreateApp: procedure
  27.  
  28.     app.Title="BitmapExample"
  29.     app.Version="$VER: BitmapExample 1.0 (12.10.2000)"
  30.     app.Copyright="©2000, alfie"
  31.     app.Author="alfie"
  32.     app.Description="BitmapExample"
  33.     app.Base="RXMUIEXAMPLE"
  34.     app.SubWindow="win"
  35.      win.ID="MAIN"
  36.      win.Title="BitmapExample"
  37.      win.Contents="MGROUP"
  38.  
  39.       mgroup.0=vspace()
  40.       mgroup.1="gg"
  41.        gg.class="group"
  42.        gg.horiz=1
  43.         gg.0=hspace()
  44.         gg.1="bm"
  45.          bm.class="bitmap"
  46.          bm.file="pics/reload.iff"
  47.          bm.inputmode="relverify"
  48.          bm.frame="button"
  49.         gg.2=hspace()
  50.       mgroup.2=vspace()
  51.  
  52.     res=NewObj("APPLICATION","APP")
  53.     if res~=0 then call err(res)
  54.  
  55.     call set("win","open",1)
  56.     call getattr("win","open","o")
  57.     if o=0 then do
  58.         say "can't open window"
  59.         exit
  60.     end
  61.  
  62.     call Notify("win","CloseRequest",1,"app","ReturnID","quit")
  63.     call Notify("bm","pressed",0,"app","return","say 'bm pressed'")
  64.  
  65.     return
  66. /***********************************************************************/
  67. halt:
  68. break_c:
  69.     exit
  70. /**************************************************************************/
  71. err: procedure expose sigl RxMUIError
  72. parse arg res
  73.     msg = ProgramName()":" GetRxMUIString(res) "in line" sigl-1
  74.     if RxMUIError~="RXMUIERROR" then msg = msg "["RxMUIError"]"
  75.     say msg
  76.     exit
  77. /**************************************************************************/
  78.